package com.briup.server.domain.dto;

import com.briup.common.constraints.Add;
import com.briup.common.constraints.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;

/**
 * 设备新增或修改数据DTO实体
 */
@Data
@Schema(description = "设备新增或修改数据DTO实体")
public class DeviceModifiedDTO {
    @Null(groups = Add.class, message = "新增时设备ID必须为空")
    @NotNull(groups = Update.class, message = "修改时设备ID不能为空")
    @Schema(description = "设备ID")
    private String id;
    @NotBlank(message = "设备名称不能为空")
    @Schema(description = "设备名称")
    private String deviceName;
    @NotBlank(message = "设备地址不能为空")
    @Schema(description = "设备地址")
    private String deviceAddr;
    @NotBlank(message = "设备类型不能为空")
    @Schema(description = "设备类型")
    private String typeId;
    @NotBlank(message = "实验室ID不能为空")
    @Schema(description = "实验室ID")
    private String labsId;
    @NotBlank(message = "打开指令不能为空")
    @Schema(description = "打开指令")
    private String open;
    @NotBlank(message = "关闭指令不能为空")
    @Schema(description = "关闭指令")
    private String close;
    @Schema(description = "最大阈值")
    private Integer maxThreshold;
    @Schema(description = "最小阈值")
    private Integer minThreshold;
}
